package com.cloudcross.ssp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloudcross.ssp.base.dao.GenericIBatisDao;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.rpt.OrderRpt;
import com.cloudcross.ssp.model.rpt.Report;
import com.cloudcross.ssp.service.IRptOrderHourService;

@Service
public class RptOrderHourService implements IRptOrderHourService {

	@Autowired
	private GenericIBatisDao myBatisDao;
	
	@Override
	public List<OrderRpt> queryOrderHourDataByCondition(Map<String, Object> condition, Pager pager) {
		if (pager == null) {
			return myBatisDao.getList("rptSqlMapper.queryOrderHourExcelByCondition", condition);
		} else {
			condition.put("pager", pager);
			return myBatisDao.getList("rptSqlMapper.queryOrderHourDataByCondition", condition);
		}
		
	}

	@Override
	public int queryOrderHourCountByCondition(Map<String, Object> condition) {
		return myBatisDao.get("rptSqlMapper.queryOrderHourCountByCondition", condition);
	}

	@Override
	public Report queryOrderHourTotalByCondition(Map<String, Object> condition) {
		return myBatisDao.get("rptSqlMapper.queryOrderHourTotalByCondition", condition);
	}

}
